package com.acme.task5;

/**
 * Class used to modify and print text
 * @author S.Zhidkov
 *
 */
public class TextModifier {
    public static void main(String[] args) {
        if (args != null && args.length < 1) {
            throw new IllegalArgumentException("You need enter string as a argument");
        }

        String str = args[0];
        for (int i = 0; i < str.length(); i++) {
            char charAtIndex = str.charAt(i);

            // skip digits
            if (Character.isDigit(charAtIndex)) {
                continue;
            }

            // doubles '+' and '-' output
            if (charAtIndex == '+' || charAtIndex == '-') {
                System.out.print(charAtIndex);
            }

            // output args[0] string char by char
            System.out.print(charAtIndex);
        }

        System.out.println();
    }
}
